function [rs,issymmetric]=reorient_descriptor(des,thresh1,thresh2,N,L)
    %% given a descriptor, calculate its principal orientation, and rotate
    %% it so that the principal orientation equals 0
    theta=principal_orientations_ext(des,thresh1,thresh2,N,L);
    %rs=zeros(numel(des),numel(theta));
    issymmetric=false;
    if(isempty(theta)) %if no principal orientation exists, it's a symmetric 
        rs=des;
        issymmetric=true;
        return;
    end
    rs=[];
    for ii=1:numel(theta)
        rotated=rotate_descriptor(des,theta(ii),N,L);
        %theta1=principal_orientations_ext(rotated,thresh1,thresh2,N,L);
        rs=cat(2,rs,rotated);
    end
    
    if(numel(theta)<1) %symmetric SP, just return the original one
        rs=des;
    end
end